import os
import random
import xml.etree.ElementTree as ET

from utils.utils import get_classes
import shutil
    
VOCdevkit_path = 'digger'
if __name__ == "__main__":


    jpgfilepath = os.path.join(VOCdevkit_path, 'JPEGImages')
    jpgFileOutPath = os.path.join(VOCdevkit_path, 'JPEGImages_out')
    files = os.listdir(jpgfilepath)
    if not os.path.exists(jpgFileOutPath):
        os.mkdir(jpgFileOutPath)    
    
    i = 1000
    files.sort()
    for fileName in files:
        i += 1
        srcJpgFile = os.path.join(jpgfilepath,fileName)
        dstJpgFile = os.path.join(jpgFileOutPath,os.path.splitext(fileName)[0]+".jpg")
        shutil.copyfile(srcJpgFile,dstJpgFile)
        print(dstJpgFile)
